home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 042a / bpl70n11.zip / ACCURACY.DOC next >
Text File  |  1993-03-07  |  5KB  |  98 lines

  1.                 Accuracy Comparison for REAL arithmetic
  2.  
  3.  
  4.                    BP 7.0 Turbo Pascal Library
  5.                               versus
  6.                 BP 7.0 Runtime Library Update 1.0
  7.  
  8.  
  9.  
  10. Test of basic arithmetic with FUN1_TST. 10,000,000 random trials per function
  11. Limit of relative error for full 40 bit accuracy is 9.094947022e-13.
  12.  
  13.                   BP 7.0 RTL                    BP 7.0 RLU 1.0
  14.  
  15.              % wrong   max. rel. error       % wrong   max. rel. error
  16.  
  17. ADD          0.0000%   9.094837432e-13       0.0000%   9.094820930e-13
  18. SUB          0.1571%   9.155430759e-13       0.0000%   9.094905407e-13
  19. MUL          0.0000%   8.459999740e-13       0.0000%   9.089090757e-13
  20. DIV          0.0000%   9.093448608e-13       0.0000%   9.093327167e-13
  21. Short-MUL *  0.0000%   9.094682364e-13       0.0000%   9.094466215e-13
  22.  
  23. * Short-MUL is a multiplication where one of the operands carries only 16
  24.   bits of precision (the last 24 mantissa bits are zero).
  25.  
  26.  
  27.  
  28. Test of higher math functions with ELEFUNT test programs. 1,000,000 random
  29. trials per function test.
  30.  
  31. MRE = maximum relative error
  32. RMS = root mean square relative error (average error)
  33.  
  34. Errors reported by ELEFUNT test programs tend to be larger than the actual
  35. error of the routines as compared to higher precision routines (coprocessor).
  36. This is due to the nature of the tests, which are based on functional
  37. identities. The additional computations in testing the identities cause
  38. additional round-off errors.
  39.  
  40.  
  41.                       BP 7.0 RTL                     BP 7.0 RLU 1.0
  42.  
  43.               % wrong    MRE         RMS        % wrong    MRE        RMS
  44.  
  45. DSQRT Test1   9.5168% 1.28622e-12 3.55691e-13   0.0000% 0.00000e+00 0.00000e+00
  46.       Test2   0.0004% 1.81880e-12 3.63514e-15   0.0000% 0.00000e+00 0.00000e+00
  47.  
  48. DSIN  Test1  48.5711% 7.27690e-12 1.23904e-12  38.4640% 2.64505e-12 7.22852e-13
  49.       Test2  84.1128% 4.11862e-04 4.11889e-07  44.0276% 8.00614e-09 8.04878e-12
  50. *     Test3  91.4008% 9.81763e-07 2.28067e-09  42.9703% 4.31878e-11 8.08930e-13
  51.  
  52. DATAN Test1  18.7838% 1.81897e-12 5.36074e-13  11.1927% 1.81897e-12 4.11701e-13
  53.       Test2  63.1259% 6.66016e-12 1.91192e-12  20.3286% 1.82093e-12 5.74504e-13
  54.       Test3  70.2866% 4.27213e-12 1.38748e-12  31.3874% 3.33085e-12 7.80409e-13
  55.       Test4  64.5424% 7.27474e-12 2.87544e-12  42.5229% 3.63782e-12 9.16674e-13
  56.  
  57. DEXP  Test1  51.1003% 4.86911e-12 1.12152e-12  29.3751% 2.93224e-12 7.09432e-13
  58.       Test2  99.4743% 6.14647e-11 2.34142e-11  30.0348% 2.95769e-12 7.24600e-13
  59.       Test3  99.7909% 6.09032e-11 2.82847e-11  30.5228% 2.94201e-12 7.30898e-13
  60.  
  61. DLOG  Test1  99.9991% 1.00000e+00 1.10905e-02  39.8793% 3.46234e-12 8.16947e-13
  62.       Test2  92.8802% 3.87388e-11 5.31959e-12  38.5649% 3.63262e-12 8.65898e-13
  63. **    Test3  73.2293% 2.84949e-11 2.72609e-12  62.3653% 5.44522e-12 1.36790e-12
  64.       Test4  22.3294% 1.81898e-12 6.51330e-13  11.5519% 2.32351e-12 4.31119e-13
  65.  
  66.  
  67. *  test of cosine function
  68. ** test of LOG10 function, here simulated by Ln(10) * Ln(X)
  69.  
  70.  
  71.  
  72. Comparison of the results returned by the higher math functions of the REAL
  73. arithmetic software routines with the results returned by a math coprocessor
  74. (Intel RapidCAD). 10,000,000 uniformly distributed arguments from the stated
  75. interval were used to test each function. Note that measuring the error in
  76. ULPs is a more accurate metric than simply measuring the relative error. An
  77. ideal function realization would have an error of exactly 0.5 ULPs.
  78.  
  79.  
  80.                            BP 7.0 RTL                     BP 7.0 RLU 1.0
  81.  
  82.          interval    % wrong        ULP error       % wrong        ULP error
  83.  
  84. EXP   -80.0 .. 80.0  94.6121% -68.4469 .. 67.5848   11.7631%  -1.4265 .. 1.4454
  85. LN    0.001 .. 20.0  90.6081% -161855. .. 96518.0   37.1437%  -1.8061 .. 2.1469
  86. SIN   -pi/2 .. pi/2  56.9757% -592880. .. 159489.    8.1556%  -1.2619 .. 0.9408
  87. COS   -pi/2 .. pi/2  76.4614% -738834. .. 1.61904 * 18.7306% -6914048 .. 1.3582
  88. ATAN  -20.0 .. 20.0  33.9098%  -4.4094 .. 2.06105   40.5580%  -1.7263 .. 1.2855
  89.  
  90. %wrong are those cases where the result returned by the REAL arithmetic
  91.        software routines differ from the result returned by the coprocessor
  92.        and rounded to the precision of the REAL type.
  93.  
  94. *      the high error in the COS routine is caused by the loss of accuracy
  95.        in the argument reduction. Loss of accuracy in the reduction process
  96.        for the SIN and COS functions can only prohibited at a relatively
  97.        high cost.
  98.